<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<input type="text" placeholder="名字">
<input type="text" placeholder="工资">
<input type="text" placeholder="工作">
<input type="button" value="添加">
<table border="1">
    <caption>员工列表</caption>
    <tr>
        <th>名字</th>
        <th>工资</th>
        <th>工作</th>
        <th>操作</th>
    </tr>
</table>

<!--引入一个jQuery框架-->
<script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
<script>
    //添加点击事件
    $("input:last").click(function () {
        //在事件中创建1个tr  3个td
        let tr = $("<tr></tr>");
        let td1 = $("<td></td>");
        let td2 = $("<td></td>");
        let td3 = $("<td></td>");
        let td4 = $("<td><input type='button' value='删除'></td>");
        td4.children().click(function () {
            //删除当前行
            tr.remove();
        })
        td1.text($("input:eq(0)").val());
        td2.text($("input:eq(1)").val());
        td3.text($("input:eq(2)").val());
        //把td装进tr
        tr.append(td1);
        tr.append(td2);
        tr.append(td3);
        tr.append(td4)
        //把tr装进table
        $("table").append(tr);


    })
</script>
</body>
</html>